﻿using ComplexNumbers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace TestComplexNumbers
{
    
    
    /// <summary>
    ///This is a test class for ComplexTest and is intended
    ///to contain all ComplexTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ComplexTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for op_Division
        ///</summary>
        [TestMethod()]
        public void op_DivisionTest()
        {
            Complex c1 = new Complex(15,0); // TODO: Initialize to an appropriate value
            Complex c2 = new Complex(3,0); // TODO: Initialize to an appropriate value
            Complex expected = new Complex(5,0); // TODO: Initialize to an appropriate value
            Complex actual;
            actual = (c1 / c2);
            Assert.AreEqual(expected, actual);
        }
        /// <summary>
        ///A test for op_Division1
        ///</summary>
        [TestMethod()]
        public void op_DivisionTest1()
        {
            Complex c1 = new Complex(15, 0); // TODO: Initialize to an appropriate value
            Complex c2 = new Complex(3, 0); // TODO: Initialize to an appropriate value
            Complex expected = new Complex(18, 0); // TODO: Initialize to an appropriate value
            Complex actual;
            actual = (c1 + c2);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Item
        ///</summary>
        [TestMethod()]
        public void ItemTest()
        {
            Complex target = new Complex(12.5,5); // TODO: Initialize to an appropriate value
            int index = 0; // TODO: Initialize to an appropriate value
            double expected = 12.5; // TODO: Initialize to an appropriate value
            double actual;
            target[index] = expected;
            actual = target[index];
            Assert.AreEqual(expected, actual);
            int index2 = 1; // TODO: Initialize to an appropriate value
            double expected2 = 5; // TODO: Initialize to an appropriate value
            double actual2;
            target[index2] = expected2;
            actual2 = target[index2];
            Assert.AreEqual(expected2, actual2);
        }
    }
}
